class Solution {
public:
	void moveZeroes(vector<int>& nums) {
		int slow = 0, fast = 0;
		while (fast < nums.size())
		{
			if (nums[slow] == 0 && nums[fast] == 0)
			{
				fast++;
			}
			else if (nums[slow] == 0)
			{
				swap(nums[slow++], nums[fast++]);
			}
			else//(nums[slow] && nums[fast] == 0 || nums[slow] && nums[fast])
			{
				slow++;
				fast++;
			}
		}
	}
};